package com.xbongbong.pro.statistic.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.pro.enums.AccessLinkEnum;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import lombok.Getter;

/**
 * 指标规则枚举，主要用于SystemCodeEnum，是systemCode组成的一部分
 *
 * 系统指标规则枚举规则：
 * 1.由二部分组成：二个数值，一两个“_”线。如“100_01”
 * 2.第一个“_”线之前的数值代表业务类型，从XbbRefTypeEnum内获取，如客户为100
 * 3.第一个“_”线之后的两位数值代表统计类型，需确保在该业务类型内该值的唯一，如客户的总数为“01”、客户新增为“02”
 *
 * @author 徐俊杰
 * @version v1.0
 * @date 2019/1/18 21:03
 * @since v1.0
 */
@Getter
public enum IndicatorRuleEnum {
    /**
     * 客户
     */
    CUSTOMER_TOTAL(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_01", "enum.indicatorRule.name.customer_total", "enum.indicatorRule.throughName.customer_total",AccessLinkEnum.CUSTOMER),
    CUSTOMER_ADD(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_02", "enum.indicatorRule.name.customer_add", "enum.indicatorRule.throughName.customer_add",AccessLinkEnum.CUSTOMER),
    CUSTOMER_FOLLOW(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_03", "enum.indicatorRule.name.customer_follow", "enum.indicatorRule.throughName.customer_follow",AccessLinkEnum.CUSTOMER),
    CUSTOMER_FORGET(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_04", "enum.indicatorRule.name.customer_forget", "enum.indicatorRule.throughName.customer_forget",AccessLinkEnum.CUSTOMER),
    CUSTOMER_BIRTHDAY(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_05", "enum.indicatorRule.name.customer_birthday", "enum.indicatorRule.throughName.customer_birthday",AccessLinkEnum.CUSTOMER),
    CUSTOMER_OK(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_06", "enum.indicatorRule.name.customer_ok", "enum.indicatorRule.throughName.customer_ok",AccessLinkEnum.CUSTOMER),
    CUSTOMER_ACTIVE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_07", "enum.indicatorRule.name.customer_active", "enum.indicatorRule.throughName.customer_active",AccessLinkEnum.CUSTOMER),
    CUSTOMER_INDUSTRY(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_08", "enum.indicatorRule.name.customer_industry", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_SOURCE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_09", "enum.indicatorRule.name.customer_source", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_TYPE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_10", "enum.indicatorRule.name.customer_type", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_MAP(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_11", "enum.indicatorRule.name.customer_map", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_TABLE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_12", "enum.indicatorRule.name.customer_table", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_FUNNEL(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_13", "enum.indicatorRule.name.customer_funnel", "enum.indicatorRule.throughName.customer_industry",AccessLinkEnum.CUSTOMER),
    CUSTOMER_VALID(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_14", "enum.indicatorRule.name.customer_valid", "enum.indicatorRule.throughName.customer_valid",AccessLinkEnum.CUSTOMER),
    CUSTOMER_LOSE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_15", "enum.indicatorRule.name.customer_lose", "enum.indicatorRule.throughName.customer_lose",AccessLinkEnum.CUSTOMER),
    CUSTOMER_LOSE_REASON(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_16", "enum.indicatorRule.name.customer_lose_reason", "enum.indicatorRule.throughName.customer_lose_reason",AccessLinkEnum.CUSTOMER),
    CUSTOMER_BEFORE_STAGE(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode() + "_17", "enum.indicatorRule.name.customer_lose_before_stage", "enum.indicatorRule.throughName.customer_lose_before_stage",AccessLinkEnum.CUSTOMER),
    CUSTOMER_SALES_ANALYSIS(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode()+ "_18", "enum.indicatorRule.name.customer_sales_analysis","enum.indicatorRule.throughName.customer_sales_analysis",AccessLinkEnum.CUSTOMER),
    CUSTOMER_DELIVERY_ANALYSIS(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode()+ "_19", "enum.indicatorRule.name.customer_delivery_analysis","enum.indicatorRule.throughName.customer_delivery_analysis",AccessLinkEnum.CUSTOMER),
    /**
     * 合同
     */
    CONTRACT_COUNT(XbbRefTypeEnum.CONTRACT.getCode() + "_01",  "enum.indicatorRule.name.contract_count", "enum.indicatorRule.throughName.contract_count", AccessLinkEnum.CONTRACT),
    CONTRACT_AMOUNT(XbbRefTypeEnum.CONTRACT.getCode() + "_02", "enum.indicatorRule.name.contract_amount", "enum.indicatorRule.throughName.contract_amount", AccessLinkEnum.CONTRACT),
    CONTRACT_PROFIT(XbbRefTypeEnum.CONTRACT.getCode() + "_03", "enum.indicatorRule.name.contract_profit", "enum.indicatorRule.throughName.contract_profit", AccessLinkEnum.CONTRACT),
    CONTRACT_PROFIT_CASH(XbbRefTypeEnum.CONTRACT.getCode() + "_06", "enum.indicatorRule.name.contract_profit_cash", "enum.indicatorRule.throughName.contract_profit_cash", AccessLinkEnum.CONTRACT),
    CONTRACT_TABLE(XbbRefTypeEnum.CONTRACT.getCode() + "_04", "enum.indicatorRule.name.contract_table", "enum.indicatorRule.throughName.contract_table", AccessLinkEnum.CONTRACT),
    RED_CONTRACT(XbbRefTypeEnum.CONTRACT.getCode() + "_05", "enum.indicatorRule.name.red_contract", "enum.indicatorRule.throughName.red_contract", AccessLinkEnum.CONTRACT),
    /**
     * 订单
     **/
    ORDER_DISTRIBUTOR(XbbRefTypeEnum.ORDER.getCode() + "_01","enum.indicatorRule.name.distributor_order", "enum.indicatorRule.throughName.distributor_order", AccessLinkEnum.ORDER),
    ORDER_PROFIT(XbbRefTypeEnum.ORDER.getCode() + "_02", "enum.indicatorRule.name.distributor_order_profit","enum.indicatorRule.throughName.distributor_order_profit", AccessLinkEnum.ORDER),
    RETURN_DISTRIBUTOR(XbbRefTypeEnum.RETURN.getCode() + "_01","enum.indicatorRule.name.distributor_return", "enum.indicatorRule.throughName.distributor_return", AccessLinkEnum.RETURN),
    /**
     * 统计内：Pk榜
     */
    PK(XbbRefTypeEnum.STATISTICS.getCode() + "_01", "enum.indicatorRule.name.pk", "", AccessLinkEnum.PK_LIST_SETTINGS),
    /**
     * 统计内：业绩目标，归属到统计服务
     */
    PERFORMANCE(XbbRefTypeEnum.STATISTICS.getCode() + "_02", "enum.indicatorRule.name.performance", "", AccessLinkEnum.PERFORMANCE_SET),
    /**
     * 目标完成情况（图表中心）
     */
    PERFORMANCE_TABLE(XbbRefTypeEnum.STATISTICS.getCode() + "_03", "enum.indicatorRule.name.performance_table", "", AccessLinkEnum.PERFORMANCE_SET),
    /**
     * 数据预警（图表中心）
     */
    DATA_WARNING(XbbRefTypeEnum.STATISTICS.getCode() + "_04","enum.indicatorRule.name.data_warning", "", AccessLinkEnum.DATA_WARNING),
    /**
     * 退货退款
     */
    RED_REFUND_PRODUCT(XbbRefTypeEnum.REFUND.getCode() + "_02", "enum.indicatorRule.name.red_refund_product", "enum.indicatorRule.throughName.red_refund_product", AccessLinkEnum.REFUND),
    RED_REFUND_REASON(XbbRefTypeEnum.REFUND.getCode() + "_04", "enum.indicatorRule.name.red_refund_reason", "enum.indicatorRule.throughName.red_refund_reason", AccessLinkEnum.REFUND),
    /**
     * 销售机会
     */
    OPPORTUNITY_ADD_COUNT(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_01", "enum.indicatorRule.name.opportunity_add_count", "enum.indicatorRule.throughName.opportunity_add_count", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_ADD_AMOUNT(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_02", "enum.indicatorRule.name.opportunity_add_amount", "enum.indicatorRule.throughName.opportunity_add_count", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_ADD(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_06", "enum.indicatorRule.name.opportunity_add", "enum.indicatorRule.throughName.opportunity_add_count", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_EXPIRE_COUNT(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_03", "enum.indicatorRule.name.opportunity_expire_count", "enum.indicatorRule.throughName.opportunity_expire_count", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_EXPIRE_AMOUNT(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_04", "enum.indicatorRule.name.opportunity_expire_amount", "enum.indicatorRule.throughName.opportunity_expire_count", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_FUNNEL(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_05", "enum.indicatorRule.name.opportunity_funnel", "enum.indicatorRule.throughName.opportunity_funnel", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_ESTIMATE(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_10", "enum.indicatorRule.name.opportunity_estimate", "enum.indicatorRule.throughName.opportunity_funnel", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_WIN(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_07", "enum.indicatorRule.name.opportunity_win", "enum.indicatorRule.throughName.opportunity_win", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_MAP(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_08", "enum.indicatorRule.name.opportunity_map", "enum.indicatorRule.throughName.opportunity_funnel", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_LOSE_CAUSE(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_09", "enum.indicatorRule.name.opportunity_lose_cause", "enum.indicatorRule.throughName.opportunity_lose_cause", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_FOLLOW(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_11", "enum.indicatorRule.name.opportunity_follow", "enum.indicatorRule.throughName.opportunity_follow", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_CUSTOMER(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_12", "enum.indicatorRule.name.opportunity_customer", "enum.indicatorRule.throughName.opportunity_customer", AccessLinkEnum.ALL_OPPORTUNITY),
    OPPORTUNITY_STAGE(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode() + "_13", "enum.indicatorRule.name.opportunity_stage", "enum.indicatorRule.throughName.opportunity_funnel", AccessLinkEnum.ALL_OPPORTUNITY),
    /**
     * 联系人
     */
    CONTACT_ADD(XbbRefTypeEnum.CONTACT.getCode() + "_01", "enum.indicatorRule.name.contact_add", "enum.indicatorRule.throughName.contact_add", AccessLinkEnum.CONTACT),
    /**
     * 跟进记录
     */
    COMMUNICATE_ADD(XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode() + "_01", "enum.indicatorRule.name.communicate_add", "enum.indicatorRule.throughName.communicate_add", AccessLinkEnum.CUSTOMER_COMMUNICATE),
    COMMUNICATE_TYPE(XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode() + "_02", "enum.indicatorRule.name.communicate_type", "enum.indicatorRule.throughName.communicate_type", AccessLinkEnum.CUSTOMER_COMMUNICATE),
    /**
     * 应收款
     */
    PAYMENT_ED(XbbRefTypeEnum.PAYMENT.getCode() + "_01", "enum.indicatorRule.name.payment_ed", "enum.indicatorRule.throughName.payment_ed", AccessLinkEnum.PAYMENT_SHEET),
    PAYMENT_UN(XbbRefTypeEnum.PAYMENT.getCode() + "_02", "enum.indicatorRule.name.payment_un", "enum.indicatorRule.throughName.payment_un", AccessLinkEnum.PAYMENT),
    PAYMENT_BAD(XbbRefTypeEnum.PAYMENT.getCode() + "_03", "enum.indicatorRule.name.payment_bad", "enum.indicatorRule.throughName.payment_bad", AccessLinkEnum.PAYMENT_SHEET),
    RED_SHEET(XbbRefTypeEnum.PAYMENT.getCode() + "_04", "enum.indicatorRule.name.red_sheet", "enum.indicatorRule.throughName.red_sheet", AccessLinkEnum.PAYMENT_SHEET),
    WRITE_OFF(XbbRefTypeEnum.PAYMENT.getCode() + "_05", "enum.indicatorRule.name.write_off", "enum.indicatorRule.throughName.write_off", AccessLinkEnum.PAYMENT_SHEET),
    PAYMENT_TASK(XbbRefTypeEnum.PAYMENT.getCode() + "_06", "enum.indicatorRule.name.payment_task", "enum.indicatorRule.throughName.payment_task", AccessLinkEnum.PAYMENT_TASK),
    /**
     * 付款计划
     */
    PAY_UN(XbbRefTypeEnum.PAY_PLAN.getCode() + "_01", "enum.indicatorRule.name.pay_un", "enum.indicatorRule.throughName.pay_un", AccessLinkEnum.PAY_PLAN),
    PAY_ED(XbbRefTypeEnum.PAY_PLAN.getCode() + "_02", "enum.indicatorRule.name.pay_ed", "enum.indicatorRule.throughName.pay_ed", AccessLinkEnum.PAY_SHEET),
    PAY_BAD(XbbRefTypeEnum.PAY_PLAN.getCode() + "_03", "enum.indicatorRule.name.pay_bad", "enum.indicatorRule.name.pay_bad", AccessLinkEnum.PAY_SHEET),
    PAY_RED(XbbRefTypeEnum.PAY_PLAN.getCode() + "_04", "enum.indicatorRule.name.pay_red", "enum.indicatorRule.name.pay_red", AccessLinkEnum.PAY_SHEET),
    WRITE_OFF_PAY(XbbRefTypeEnum.PAY_PLAN.getCode() + "_05", "enum.indicatorRule.name.write_off_pay", "enum.indicatorRule.name.write_off_pay", AccessLinkEnum.PAY_SHEET),
    /**
     * 其他收入单
     */
    OTHER_INCOME_AMOUNT(XbbRefTypeEnum.OTHER_INCOME.getCode() + "_01", "enum.indicatorRule.name.other_income_amount", "enum.indicatorRule.name.other_income_amount", AccessLinkEnum.OTHER_INCOME),
    OTHER_INCOME_RED_AMOUNT(XbbRefTypeEnum.OTHER_INCOME.getCode() + "_02", "enum.indicatorRule.name.other_income_red_amount", "enum.indicatorRule.name.other_income_red_amount", AccessLinkEnum.OTHER_INCOME),
    OTHER_INCOME(XbbRefTypeEnum.OTHER_INCOME.getCode() + "_03", "enum.indicatorRule.name.other_income", "enum.indicatorRule.name.other_income", AccessLinkEnum.OTHER_INCOME),
    /**
     *其他支出单
     */
    OTHER_EXPENSE_AMOUNT(XbbRefTypeEnum.OTHER_EXPENSE.getCode() + "_01", "enum.indicatorRule.name.other_expense_amount", "enum.indicatorRule.name.other_expense_amount", AccessLinkEnum.OTHER_EXPENSE),
    OTHER_EXPENSE_RED_AMOUNT(XbbRefTypeEnum.OTHER_EXPENSE.getCode() + "_02", "enum.indicatorRule.name.other_expense_red_amount", "enum.indicatorRule.name.other_expense_red_amount", AccessLinkEnum.OTHER_EXPENSE),
    OTHER_EXPENSE(XbbRefTypeEnum.OTHER_EXPENSE.getCode() + "_03", "enum.indicatorRule.name.other_expense", "enum.indicatorRule.name.other_expense", AccessLinkEnum.OTHER_EXPENSE),
    /**
     * 发票
     */
    INVOICE_ED(XbbRefTypeEnum.INVOICE.getCode() + "_01", "enum.indicatorRule.name.invoice_ed", "enum.indicatorRule.throughName.invoice_ed", AccessLinkEnum.INVOICE),
    INVOICE(XbbRefTypeEnum.INVOICE.getCode() + "_02", "enum.indicatorRule.name.invoice", "enum.indicatorRule.name.invoice", AccessLinkEnum.INVOICE),
    PURCHASE_INVOICE(XbbRefTypeEnum.INVOICE.getCode() + "_03", "enum.indicatorRule.name.purchase_invoice", "enum.indicatorRule.name.purchase_invoice", AccessLinkEnum.PURCHASE_INVOICE),
    /**
     * 采购合同
     */
    PURCHASE_COUNT(XbbRefTypeEnum.PURCHASE.getCode() + "_01", "enum.indicatorRule.name.purchase_count", "enum.indicatorRule.throughName.purchase_count", AccessLinkEnum.PURCHASE),
    PURCHASE_AMOUNT(XbbRefTypeEnum.PURCHASE.getCode() + "_02", "enum.indicatorRule.name.purchase_amount", "enum.indicatorRule.throughName.purchase_count", AccessLinkEnum.PURCHASE),
    PURCHASE_TABLE(XbbRefTypeEnum.PURCHASE.getCode() + "_03", "enum.indicatorRule.name.purchase_table", "", AccessLinkEnum.PURCHASE),
    PURCHASE_SUPPLIER(XbbRefTypeEnum.PURCHASE.getCode() + "_04", "enum.indicatorRule.name.purchase_supplier", "", AccessLinkEnum.SUPPLIER),
    /**
     * 仓库
     */
    STOCK_TABLE(XbbRefTypeEnum.WAREHOUSE.getCode() + "_02", "enum.indicatorRule.name.stock_table", "", AccessLinkEnum.WAREHOUSE),
    STOCK_PRODUCT(XbbRefTypeEnum.WAREHOUSE.getCode() + "_03", "enum.indicatorRule.name.stock_product", "", AccessLinkEnum.OUTSTOCK_MANAGEMENT),
    /**
     * 工单
     */
    WORK_ORDER_TOTAL(XbbRefTypeEnum.WORK_ORDER.getCode() + "_05", "enum.indicatorRule.name.work_order_total", "enum.indicatorRule.throughName.work_order_total", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_ADD(XbbRefTypeEnum.WORK_ORDER.getCode() + "_01", "enum.indicatorRule.name.work_order_add", "enum.indicatorRule.throughName.work_order_add", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_CLOSE(XbbRefTypeEnum.WORK_ORDER.getCode() + "_02", "enum.indicatorRule.name.work_order_close", "enum.indicatorRule.throughName.work_order_close", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_FINISH(XbbRefTypeEnum.WORK_ORDER.getCode() + "_03", "enum.indicatorRule.name.work_order_finish", "enum.indicatorRule.throughName.work_order_finish", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_FINISH_DELAY(XbbRefTypeEnum.WORK_ORDER.getCode() + "_04", "enum.indicatorRule.name.work_order_finish_delay", "enum.indicatorRule.throughName.work_order_finish_delay", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_FINISH_INTIME(XbbRefTypeEnum.WORK_ORDER.getCode() + "_06", "enum.indicatorRule.name.work_order_finish_intime", "enum.indicatorRule.throughName.work_order_finish_intime", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_DEGREE(XbbRefTypeEnum.WORK_ORDER.getCode() + "_07", "enum.indicatorRule.name.work_order_degree", "enum.indicatorRule.throughName.work_order_degree", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_FINISH_TIME(XbbRefTypeEnum.WORK_ORDER.getCode() + "_08", "enum.indicatorRule.name.work_order_finish_time", "enum.indicatorRule.throughName.work_order_finish_time", AccessLinkEnum.WORK_ORDER),
    WORK_ORDER_PRICE(XbbRefTypeEnum.WORK_ORDER.getCode() + "_09", "enum.indicatorRule.name.work_order_price", "enum.indicatorRule.throughName.work_order_finish_time", AccessLinkEnum.WORK_ORDER),
    /**
     * 产品
     */
    PRODUCT_SALES(XbbRefTypeEnum.PRODUCT.getCode() + "_01", "enum.indicatorRule.name.product_sales", "enum.indicatorRule.throughName.product_sales", AccessLinkEnum.PRODUCT),
    PRODUCT_TABLE(XbbRefTypeEnum.PRODUCT.getCode() + "_02", "enum.indicatorRule.name.product_table", "", AccessLinkEnum.PRODUCT),
    PRODUCT_CATEGORY_RATE(XbbRefTypeEnum.PRODUCT.getCode() + "_04", "enum.indicatorRule.name.product_category_rate", "", AccessLinkEnum.PRODUCT),
    PRODUCT_PROFIT(XbbRefTypeEnum.PRODUCT.getCode() + "_05", "enum.indicatorRule.name.product_profit", "", AccessLinkEnum.PRODUCT),
    PRODUCT_COST(XbbRefTypeEnum.PRODUCT.getCode() + "_06", "enum.indicatorRule.name.product_cost", "", AccessLinkEnum.PRODUCT),
    ORDER_PRODUCT(XbbRefTypeEnum.PRODUCT.getCode() + "_07", "enum.indicatorRule.name.order_product", "enum.indicatorRule.throughName.order_product", AccessLinkEnum.PRODUCT),
    RETURN_PRODUCT(XbbRefTypeEnum.PRODUCT.getCode() + "_08", "enum.indicatorRule.name.return_product", "enum.indicatorRule.throughName.return_product", AccessLinkEnum.PRODUCT),
    /**
     * 生产单
     */
    PRODUCTION_ORDER_ADD(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_01", "enum.indicatorRule.name.production_order_add", "enum.indicatorRule.throughName.production_order_add", AccessLinkEnum.PRODUCTION_ORDER),
    PRODUCTION_ORDER_COMPLETE(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_02", "enum.indicatorRule.name.production_order_complete", "enum.indicatorRule.throughName.production_order_complete", AccessLinkEnum.PRODUCTION_ORDER),
    PRODUCTION_ORDER_FINISHED(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_03", "enum.indicatorRule.name.production_order_finished", "", AccessLinkEnum.PRODUCTION_ORDER),
    PRODUCTION_ORDER_TOTAL(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_04", "enum.indicatorRule.name.production_order_total", "enum.indicatorRule.throughName.production_order_complete", AccessLinkEnum.PRODUCTION_ORDER),
    PRODUCTION_ORDER_FINISH_INTIME(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_05", "enum.indicatorRule.name.production_order_finish_intime", "enum.indicatorRule.throughName.production_order_finish_intime", AccessLinkEnum.PRODUCTION_ORDER),
    PRODUCTION_ORDER_FINISH_DELAY(XbbRefTypeEnum.PRODUCTION_ORDER.getCode() + "_06", "enum.indicatorRule.name.production_order_finish_delay", "enum.indicatorRule.throughName.production_order_finish_delay", AccessLinkEnum.PRODUCTION_ORDER),

    /**
     * 报价单
     */
    QUOTATION_COUNT(XbbRefTypeEnum.QUOTATION.getCode() + "_01", "enum.indicatorRule.name.quotation_count", "enum.indicatorRule.throughName.quotation_count", AccessLinkEnum.QUOTATION),
    QUOTATION_AMOUNT(XbbRefTypeEnum.QUOTATION.getCode() + "_02", "enum.indicatorRule.name.quotation_amount", "enum.indicatorRule.throughName.quotation_amount", AccessLinkEnum.QUOTATION),
    QUOTATION_CONVERSION(XbbRefTypeEnum.QUOTATION.getCode() + "_03", "enum.indicatorRule.name.quotation_conversion", "enum.indicatorRule.throughName.quotation_conversion", AccessLinkEnum.QUOTATION),
    QUOTATION_CUSTOMER_COUNT(XbbRefTypeEnum.QUOTATION.getCode() + "_04", "enum.indicatorRule.name.quotation_customer_count", "enum.indicatorRule.throughName.quotation_customer_count", AccessLinkEnum.QUOTATION),
    QUOTATION_CONVERSION_AMOUNT(XbbRefTypeEnum.QUOTATION.getCode() + "_05", "enum.indicatorRule.name.quotation_conversion_amount", "enum.indicatorRule.throughName.quotation_conversion_amount", AccessLinkEnum.QUOTATION),

    /**
     * 呼叫中心
     */
    CALL_CENTER(XbbRefTypeEnum.CALL_CENTER.getCode() + "_01", "enum.indicatorRule.name.call_center", "enum.indicatorRule.throughName.call_center", AccessLinkEnum.CALL_CENTER),

    /**
     * 资金
     */
    INCOME_AND_EXPENDITURE(XbbRefTypeEnum.FUND_MANAGEMENT.getCode() + "_01", "enum.systemCode.name.income_and_expenditure", "enum.systemCode.name.income_and_expenditure", AccessLinkEnum.FUND_MANAGEMENT),
    CUSTOMER_INTERACTION_ANALYSIS(XbbRefTypeEnum.FUND_MANAGEMENT.getCode() + "_02", "enum.systemCode.name.customer_interaction_analysis", "enum.systemCode.name.customer_interaction_analysis", AccessLinkEnum.CUSTOMER),
    SUPPLIER_DEALING_ANALYSIS(XbbRefTypeEnum.FUND_MANAGEMENT.getCode() + "_03", "enum.systemCode.name.supplier_dealing_analysis", "enum.systemCode.name.supplier_dealing_analysis", AccessLinkEnum.SUPPLIER),

    /**
     * 当前线索数
     */
    CLUE_TOTAL(XbbRefTypeEnum.CLUE.getCode() + "_01", "enum.indicatorRule.name.clue_total", "enum.indicatorRule.throughName.clue_total",AccessLinkEnum.CLUE),
    /**
     * 新增线索数
     */
    CLUE_ADD(XbbRefTypeEnum.CLUE.getCode() + "_02", "enum.indicatorRule.name.clue_add", "enum.indicatorRule.throughName.clue_add",AccessLinkEnum.CLUE),
    /**
     * 跟进线索数
     */
    CLUE_FOLLOW(XbbRefTypeEnum.CLUE.getCode() + "_03", "enum.indicatorRule.name.clue_follow", "enum.indicatorRule.throughName.clue_follow",AccessLinkEnum.CLUE),
    /**
     * 已转化线索数
     */
    CLUE_CONVERSION(XbbRefTypeEnum.CLUE.getCode() + "_04", "enum.indicatorRule.name.clue_conversion", "enum.indicatorRule.throughName.clue_conversion", AccessLinkEnum.CLUE),
    /**
     * 线索转化率
     */
    CLUE_CONVERSION_RATE(XbbRefTypeEnum.CLUE.getCode() + "_05", "enum.indicatorRule.name.clue_conversion_rate", "enum.indicatorRule.throughName.clue_conversion_rate", AccessLinkEnum.CLUE),
    /**
     * 线索阶段
     */
    CLUE_STAGE(XbbRefTypeEnum.CLUE.getCode() + "_06", "enum.indicatorRule.name.clue_stage", "enum.indicatorRule.throughName.clue_stage", AccessLinkEnum.CLUE),
    /**
     * 线索来源
     */
    CLUE_SOURCE(XbbRefTypeEnum.CLUE.getCode() + "_07", "enum.indicatorRule.name.clue_source", "enum.indicatorRule.throughName.clue_source", AccessLinkEnum.CLUE),
    /**
     * 无效线索原因
     */
    CLUE_INVALID_RESOURCE(XbbRefTypeEnum.CLUE.getCode() + "_08", "enum.indicatorRule.name.clue_invalid_resource", "enum.indicatorRule.throughName.clue_invalid_resource", AccessLinkEnum.CLUE),



    /**
     * 市场活动ROI
     */
    MARKET_ACTIVITY_ROI(XbbRefTypeEnum.MARKET_ACTIVITY.getCode() + "_01", "enum.indicatorRule.name.market_activity_roi", "enum.indicatorRule.throughName.market_activity_roi", AccessLinkEnum.CLUE),
    /**
     * 市场活动转化ROI分析
     */
    MARKET_ACTIVITY_CONVERSION_ROI(XbbRefTypeEnum.MARKET_ACTIVITY.getCode() + "_02", "enum.indicatorRule.name.market_activity_conversion_roi", "enum.indicatorRule.throughName.market_activity_conversion_roi", AccessLinkEnum.CLUE),
    /**
     * 活动转化类型
     */
    MARKET_ACTIVITY_TYPE_CONVERSION_ROI(XbbRefTypeEnum.MARKET_ACTIVITY.getCode() + "_03", "enum.indicatorRule.name.market_activity_type_conversion_roi", "enum.indicatorRule.throughName.market_activity_type_conversion_roi", AccessLinkEnum.CLUE),

    /**
     * 工单2.0
     */
    WORK_ORDER_V2_COUNT_ADD(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_01", "enum.indicatorRule.name.work_order_v2_count_add", "enum.indicatorRule.throughName.work_order_v2_count_add", AccessLinkEnum.WORK_ORDER_V2),
    WORK_ORDER_V2_COUNT_FINISH(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_02", "enum.indicatorRule.name.work_order_v2_count_finish", "enum.indicatorRule.throughName.work_order_v2_count_finish", AccessLinkEnum.WORK_ORDER_V2),
    WORK_ORDER_V2_COUNT_CANCEL(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_03", "enum.indicatorRule.name.work_order_v2_count_cancel", "enum.indicatorRule.throughName.work_order_v2_count_cancel", AccessLinkEnum.WORK_ORDER_V2),
    WORK_ORDER_V2_REASON_TRANSFER(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_04", "enum.indicatorRule.name.work_order_v2_reason_transfer", "enum.indicatorRule.throughName.work_order_v2_reason_transfer", AccessLinkEnum.WORK_ORDER_V2),
    WORK_ORDER_V2_REASON_REFUSE(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_05", "enum.indicatorRule.name.work_order_v2_reason_refuse", "enum.indicatorRule.throughName.work_order_v2_reason_refuse", AccessLinkEnum.WORK_ORDER_V2),
    WORK_ORDER_V2_REASON_CANCEL(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_06", "enum.indicatorRule.name.work_order_v2_reason_cancel", "enum.indicatorRule.throughName.work_order_v2_reason_cancel", AccessLinkEnum.WORK_ORDER_V2),

    //工单完成数
    WORK_ORDER_V2_COMPLETION_NUM(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_07", "enum.indicatorRule.name.work_order_v2_completion_num", "enum.indicatorRule.throughName.work_order_v2_completion_num", AccessLinkEnum.WORK_ORDER_V2),
    //员工工单满意度
    WORK_ORDER_V2_EMPLOYEE_WORK_ORDER_SATISFACTION(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_08", "enum.indicatorRule.name.work_order_v2_returning_work_order_num", "enum.indicatorRule.throughName.work_order_v2_returning_work_order_num", AccessLinkEnum.WORK_ORDER_V2),
    //工单模板数量统计
    WORK_ORDER_V2_TEMPLATE_NUM(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_09", "enum.indicatorRule.name.work_order_v2_template_num", "enum.indicatorRule.throughName.work_order_v2_template_num", AccessLinkEnum.WORK_ORDER_V2),
    //工单产品分类
    WORK_ORDER_V2_PRODUCT_CATEGORY(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_10", "enum.indicatorRule.name.work_order_v2_product_category", "enum.indicatorRule.throughName.work_order_v2_product_category", AccessLinkEnum.WORK_ORDER_V2),
    //工单产品汇总（销量指标）
    WORK_ORDER_V2_PRODUCT_COLLECT(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_11", "enum.indicatorRule.name.work_order_v2_product_collect", "enum.indicatorRule.throughName.work_order_v2_product_collect", AccessLinkEnum.WORK_ORDER_V2),
    /**
     * 工单分析 - 员工人效统计
     */
    WORK_ORDER_V2_EFFICIENCY_ANALYSIS(XbbRefTypeEnum.WORK_ORDER_V2.getCode() + "_12","enum.indicatorRule.name.work_order_v2_efficiency_analysis","enum.indicatorRule.name.work_order_v2_efficiency_analysis",AccessLinkEnum.WORK_ORDER_V2),


    //回执单产品汇总
    RECEIPT_PRODUCT(XbbRefTypeEnum.RECEIPT_ORDER.getCode() + "_01", "enum.indicatorRule.name.receipt_product", "", AccessLinkEnum.RECEIPT_ORDER),
    //回执单销售分类统计
    RECEIPT_MARKET(XbbRefTypeEnum.RECEIPT_ORDER.getCode() + "_02", "enum.indicatorRule.name.receipt_market", "", AccessLinkEnum.RECEIPT_ORDER),
    //员工服务分析
    RECEIPT_SERVICE(XbbRefTypeEnum.RECEIPT_ORDER.getCode() + "_03", "enum.indicatorRule.name.receipt_service", "", AccessLinkEnum.RECEIPT_ORDER),
    //回执单毛利分析
    RECEIPT_GROSS_MARGIN(XbbRefTypeEnum.RECEIPT_ORDER.getCode() + "_04", "enum.indicatorRule.name.receipt_gross_margin", "", AccessLinkEnum.RECEIPT_ORDER),
    //回执单金额分析
    RECEIPT_AMOUNT(XbbRefTypeEnum.RECEIPT_ORDER.getCode() + "_05", "enum.indicatorRule.name.receipt_amount", "", AccessLinkEnum.RECEIPT_ORDER),

    /**
     * 未知
     */
    UNKNOWN(XbbRefTypeEnum.UNKNOWN.getCode() + "", "enum.indicatorRule.name.unknown", "enum.indicatorRule.throughName.unknown", AccessLinkEnum.HELP),
    ;

    /**
     * 规则枚举code
     */
    private String code;
    /**
     * 该规则名
     */
    private String name;
    /**
     * 用来标记穿透后标题内的业务名部分
     */
    private String throughName;

    /**
     * 对应的系统应用
     */
    private AccessLinkEnum accessLinkEnum;

    IndicatorRuleEnum(String code, String name, String throughName, AccessLinkEnum accessLinkEnum) {
        this.code = code;
        this.name = name;
        this.throughName = throughName;
        this.accessLinkEnum = accessLinkEnum;
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }

    public String getThroughName() {
        return I18nMessageUtil.getMessage(throughName);
    }

}
